package com.wzl.plugins;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Nacos启动类
 *
 * @author weizhongli
 * @since 2022-09-01 20:37
 */
@Slf4j
@SpringBootApplication
@MapperScan({
        "com.wzl.plugins.mapper"
})
@EnableDiscoveryClient
public class NacosPluginsApplication {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        try{
            SpringApplication.run(NacosPluginsApplication.class, args);
            log.info("************第三方组件使用Nacos启动成功************");
        }catch (Exception e){
            log.error("", e);
            log.error("************第三方组件使用Nacos启动失败************");
        }
    }

}